﻿
/*----------------------------------------------------------------//
// 文件名：MoTrole.cs
// 文件功能描述：实体 MoTrole.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTrole
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoTrole
    /// </summary>
    public partial class MoTrole : ICloneable
    {
        #region 表Trole的字段
        private string roleId;
        private string roleName;
        private string rem;
        #endregion

        #region 构造函数
        public MoTrole()
        {


        }
        #endregion

        #region 拷贝构造函数

        public MoTrole(MoTrole item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoTrole(string roleId, string roleName, string rem)
        {
            this.roleId = roleId;
            this.roleName = roleName;
            this.rem = rem;
        }
        #endregion

        #region 表Trole的字段属性
        /// <summary>
        /// ROLE_ID
        /// </summary>
        public string RoleId
        {
            get { return roleId; }
            set { roleId = value; }
        }
        /// <summary>
        /// ROLE_NAME
        /// </summary>
        public string RoleName
        {
            get { return roleName; }
            set { roleName = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoTrole CopyTo(MoTrole item)
        {
            item.roleId = this.roleId;
            item.roleName = this.roleName;
            item.rem = this.rem;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoTrole mo = new MoTrole();
            mo.RoleId = this.RoleId;
            mo.RoleName = this.RoleName;
            mo.Rem = this.Rem;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoTrole NewTrole = obj as MoTrole;
                if (NewTrole == null)
                {
                    return false;
                }
                else
                {
                    if (NewTrole.RoleId == this.RoleId && NewTrole.RoleName == this.RoleName && NewTrole.Rem == this.Rem)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "RoleId={0}/RoleName={1}/Rem={2}", roleId, roleName, rem);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Role_ID"] != null && row["Role_ID"] != DBNull.Value)
            {
                this.RoleId = (string)row["Role_ID"];
            }
            else
            {
                this.RoleId = string.Empty;
            }
            if (row["Role_Name"] != null && row["Role_Name"] != DBNull.Value)
            {
                this.RoleName = (string)row["Role_Name"];
            }
            else
            {
                this.RoleName = string.Empty;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Role_ID"] = this.RoleId;
            row["Role_Name"] = this.RoleName;
            row["Rem"] = this.Rem;
        }
        #endregion
    }
}
#endregion
